/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主要内容样式 */
main {
    padding: 40px 0;
}

.contribution-form {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.contribution-form h2 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.contribution-form p {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.6;
}

/* ID查询样式 */
.id-search-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.id-search-section h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.id-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#searchIdInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#searchIdInput:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-result {
    min-height: 50px;
}

.result-card {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.result-header h3 {
    margin: 0;
    color: #495057;
}

.result-id {
    font-size: 14px;
    color: #6c757d;
    background-color: #f1f3f4;
    padding: 3px 8px;
    border-radius: 4px;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.result-label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.result-value {
    color: #333;
    flex: 1;
}

.status-approved {
    color: #28a745;
    font-weight: 600;
}

.status-rejected {
    color: #dc3545;
    font-weight: 600;
}

.status-pending {
    color: #ffc107;
    font-weight: 600;
}

.loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* 预览部分样式 */
.preview-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.preview-section h2 {
    color: #444;
    margin-bottom: 20px;
    font-size: 1.8rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.preview-container {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 20px;
    background-color: #fafafa;
}

.preview-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.preview-container h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.preview-category {
    color: #667eea;
    margin-bottom: 15px;
    font-weight: 600;
}

.preview-content {
    line-height: 1.8;
    color: #555;
    min-height: 100px;
    white-space: pre-wrap;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

footer p {
    margin-bottom: 10px;
}

.admin-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.admin-link:hover {
    text-decoration: underline;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #444;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
    color: #666;
}

#submissionId {
    font-weight: 600;
    color: #667eea;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .preview-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .contribution-form,
    .preview-section {
        padding: 20px;
    }
    
    .form-group {
        padding: 0 15px;
    }
    
    /* ID查询响应式 */
    .id-search-section {
        padding: 15px;
    }
    
    .id-search-section h2 {
        font-size: 1.3rem;
    }
    
    .id-search-container {
        flex-direction: column;
    }
    
    #searchIdInput {
        font-size: 16px;
        padding: 12px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .result-label {
        min-width: auto;
    }
    
    /* 管理后台响应式样式 */
    .dashboard-container {
        padding: 10px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    /* 表格响应式处理 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 3px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* 模态框响应式 */
    .modal-content {
        margin: 10px;
        max-width: none;
    }
    
    .submission-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}